import {Http} from "@angular/http";

import {Observable}     from 'rxjs/Observable';

// Observable class extensions
import 'rxjs/add/observable/of';

import 'rxjs/add/operator/map';
import {Injectable} from "@angular/core";

@Injectable()
export class HttpUtil {
  constructor(private http: Http) {
  }

  get(url: string, params: URLSearchParams): Observable<any> {
    return this.http.get(url, {search: params.toString()}).map(res => {
      let response = res.json();
      return response
    }, err => {
      return err;
    })
  }

}
